package com.vhall.component.service.filter;


import com.vhall.component.entity.filter.FilterWordsEntity;
import com.vhall.component.entity.filter.vo.FilterWordsImportRspVO;
import com.vhall.component.entity.filter.vo.FilterWordsListReqVO;
import com.vhall.component.entity.filter.vo.FilterWordsListRspVO;
import com.vhall.component.entity.page.vo.PageVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;


/**
 * @author longzhen.gong
 * @date 2021/7/2 17:14
 */

public interface FilterWordsService {

    PageVO<FilterWordsListRspVO> list(FilterWordsListReqVO reqVO, Integer accountId);


    List<FilterWordsEntity> checkFilterWordsRepeat(String keyword, Integer accountId, String roomId);

    boolean checkFilterWords(String keyword);

    /**
     * 创建过滤词
     *
     * @param keyword   过滤词
     * @param accountId 账户ID
     * @param userId    用户id
     * @param roomId    房间id
     * @return FilterWordsEntity
     */
    FilterWordsEntity create(String keyword, Integer accountId, Integer userId, String roomId);

    Boolean update(Integer id, String keyword, String roomId, Integer accountId, Integer userId);

    Integer delete(String ids);

    FilterWordsImportRspVO importFile(String roomId, MultipartFile file, Integer accountId, Integer userId);

    /**
     * 实时更新敏感词
     *
     * @param dealType      处理类型    0-新增，1-更新，2-删除
     * @param keyword       敏感词
     * @param oldFilterWord 修改前的敏感词（编辑情况存在）
     * @param roomId        房间ID
     */
    void liveUpdateFilterWord(String dealType, String keyword, String oldFilterWord, String roomId);
}
